package com.qiangqiang.controller;

import com.qiangqiang.entity.DorStu;
import com.qiangqiang.service.DorStuService;
import com.qiangqiang.util.ResultVOUtil;
import com.qiangqiang.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by q on 2018/2/20.
 */
@RestController
@RequestMapping("/dorstu")
public class DorStuController {
    @Autowired
    private DorStuService dorStuService;

    @PostMapping("/update")
    public ResultVO<DorStu> addOrUpdateRelationShip(DorStu dorStu) {
        return ResultVOUtil.success(dorStuService.addOrUpdateRelationShip(dorStu));
    }

    @PostMapping("/delete")
    public ResultVO deleteRelationShip(String dId, String sId) {
        dorStuService.deleteRelationShip(dId, sId);
        return ResultVOUtil.success();
    }

}
